﻿using System;
using System.Drawing;

namespace GIMS.Def.Arguments
{
    public class ColorArgument : Argument
    {
        private Color color;

        public ColorArgument()
        {
            name = "Color Argument";
            type=Flags.ArgumentType.color;
            color=Color.Black;
        }

        public Color Color
        {
            get { return color; }
            set
            {
                color = value;
                OnPropertyChanged("color");
            }
        }

        public override string CreateScriptPart()
        {
            decimal aChannel = (decimal)color.A/255;
            return string.Concat("rgba(", color.R.ToString(), ",", color.G.ToString(), ",", color.B.ToString(), ",", aChannel.ToString(), ")");
        }
    }
}
